package com.icangya.DAO.impl;

import com.icangya.DAO.IDomainDAO;
import com.icangya.domain.DomainDO;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public class DomainDAOImpl extends BaseDAO<DomainDO> implements IDomainDAO{



    @Override
    public List<DomainDO> selectDomains() {
        String hql =" FROM DomainDO domainDO ";
        List<DomainDO> list = (List<DomainDO>) getHibernateTemplate().find(hql);
        if (list != null && list.size() > 0){
            return list;
        }

        return null;
    }

    @Override
    public List<DomainDO> getDomain() {

        String hql =" FROM DomainDO domainDO WHERE isavailable = 1 ";

        List<DomainDO> domainDOList = (List<DomainDO>)getHibernateTemplate().find(hql);

        return domainDOList;
    }
}
